home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-11-11 | 10.3 KB | 339 lines | [TEXT/EDIT] |
- ;
- ; PCBASICconst 11/11/88
- ;
- ; PCBASIC run-time variable definitions
- ;
- ; by Pterodactyl Software, Copyright © 1985-1988
- ;
- ; Environment
- ;
- BLANKS ON
- STRING ASIS
- PRINT OFF
- ;
- ;
- ; Variable Definitions by Offset
- ;
- ;
- str$top equ -4 ; strtop: longint; { Pointer to end of strings}
- str$ptr equ str$top-4 ; strptr: longint; { Pointer to string-area segment}
- heap$len equ str$ptr-4 ; heaplen: longint; { Length of file-area segment}
- heap$ptr equ str$ptr-8 ; heaptr: longint; { Pointer to file-area segment}
- scrn$ptr equ heap$ptr-4 ; scrnptr: longint; { Pointer to screen-area segment}
- trap$ptr equ scrn$ptr-4 ; trapptr : ptr; { Pointer to trap-area segment}
- trap$len equ trap$ptr-2 ; traplen : integer; { Length of trap-area segment}
- bor$hand equ trap$len-4 ; border: RgnHandle; { Border region}
- line$num equ bor$hand-2 ; line_no: integer; { BASIC Line Number}
- err$num equ line$num-2 ; err_no: integer; { Error number }
- c$ommand equ err$num-2 ; command: integer; { Pascal routine to execute }
- file$buf equ c$ommand-258 ; pad : integer; { I/O may overshoot buffer }
- ; file_str: string [255]; {record for I/O}
- file$len equ file$buf ; first byte of string is length
- file$str equ file$buf+1 ; then data follows
- file$num equ file$buf-4 ; file_num: longint; {reference number for file I/O}
- file$ptr equ file$num-4 ; file_ptr: longint; {pointer to file I/O buffer}
- ; conversion parameter
- int$x equ file$ptr-2 ; intx : integer; { Integer input}
- int$y equ int$x-2 ; inty : integer; { Integer input}
- fp$x equ int$y-4 ; fpx : real; { Floating input}
- fp$y equ fp$x-4 ; fpy : real; { Floating output}
- str$x equ fp$y-256 ; strx : string[255] { String input}
- str$y equ str$x-30 ; stry : string[29] { String output}
- ; device parameters
- pos$1 equ str$y-2 ; pos1 : integer; { Printer 1 column, 1..132}
- wid$1 equ pos$1-2 ; wid1 : integer; { Printer 1 width, 1 .. 255}
- pos$2 equ wid$1-2 ; pos2 : integer; { Printer 2 column, 1..132}
- wid$2 equ pos$2-2 ; wid2 : integer; { Printer 2 width, 1 .. 255}
- pos$3 equ wid$2-2 ; pos3 : integer; { Printer 3 column, 1..132}
- wid$3 equ pos$3-2 ; wid3 : integer; { Printer 3 width, 1 .. 255}
- ; screen parameters
- pos$0 equ wid$3-2 ; pos0 : integer; { Cursor column, 1..80}
- wid$0 equ pos$0-2 ; wid0 : integer; { Screen width, 40 or 80}
- csr$lin equ wid$0-2 ; csrlin: integer; { Cursor line, 1..25}
- lp$x equ csr$lin-2 ; lpx : integer; { x coörd of last point refereneced }
- lp$y equ csr$lin-4 ; lpy : integer; { y coörd of last point refereneced }
- ap$x equ csr$lin-6 ; apx : integer; { x coörd of point A }
- ap$y equ csr$lin-8 ; apy : integer; { y coörd of point A }
- bp$x equ csr$lin-10 ; bpx : integer; { x coörd of point B }
- bp$y equ csr$lin-12 ; bpy : integer; { y coörd of point B }
- a$spect equ csr$lin-16 ; aspect: real; { Circle aspect ratio}
- def$asp equ a$spect-4 ; DefAspect :real; {Default value for aspect}
- csr$ptrn equ def$asp-68 ; csrpat: cursor; { Cursor data,
- csr$mask equ csr$ptrn+32 ; mask,
- csr$spot equ csr$mask+32 ; and hot spot}
- edit$rec equ csr$ptrn-28 ; EditRect: rect { Window data area}
- cfig$upd equ csr$ptrn-30 ; CfigUpdate: integer{ Update & buffer options}
- vis$pg equ csr$ptrn-31 ; byte visual (top) page LSB
- act$page equ csr$ptrn-32 ; byte active (output) page MSB
- ;
- ;
- asm$var equ act$page-1200 ; asmvar: array [1..300] of longint
- ;
- ;
- ; screen ASM values
- max$pg equ asm$var+18 ; byte maximum page num in use for seg size
- for$col equ asm$var+19 ; byte foreground color or pen pattern
- back$col equ asm$var+20 ; byte background color
- bor$col equ asm$var+21 ; byte border color or text face
- scrn$mode equ asm$var+22 ; word screen mode. >2 -> font(n)
- csr$vue equ asm$var+24 ; word 0=hide cursor, 1=show, else init
- csr$flg equ asm$var+26 ; byte $40 -> Show carret. $80 -> On screen
- csr$top equ asm$var+28 ; word first cursor line
- csr$bot equ asm$var+30 ; word last cursor scan line
- csr$pnt equ asm$var+32 ; long pointer into active page
- text$mod equ asm$var+36 ; byte mode for drawing text
- text$fac equ asm$var+37 ; byte text face
- font$asc equ asm$var+38 ; word text font Ascent
- font$des equ asm$var+40 ; word text font Descent
- ; zooming values
- view$lft equ asm$var+44 ; word clip region & viewport left
- view$top equ asm$var+46 ; word clip region & viewport top
- view$rt equ asm$var+48 ; word clip region & viewport right
- view$bot equ asm$var+50 ; word clip region & viewport bottom
- wind$lft equ asm$var+52 ; long window left
- wind$top equ asm$var+56 ; long window top
- wind$rt equ asm$var+60 ; long window right
- wind$bot equ asm$var+64 ; long window bottom
- vuoff$x equ asm$var+68 ; word viewport x offset
- vuoff$y equ asm$var+70 ; word viewport y offset
- wdoff$x equ asm$var+72 ; long window x offset
- wdoff$y equ asm$var+76 ; long window y offset
- wdmul$x equ asm$var+80 ; long window x multiplier or 0 if no window
- wdmul$y equ asm$var+84 ; long window y multiplier or 0 if no window
- ;
- err$adr equ asm$var+92 ; long address for error retry
- file$mode equ asm$var+100 ; word file I/O mode command for open
- rec$num equ file$mode+2 ; long record nuimber for get or put
- fil$hands equ file$mode+6 ; long file handles available
- line$adr equ file$mode+10 ; long line start+4 in case of error
- retry$stk equ line$adr+4 ; long restore to A7 on error retry
- stack$bot equ line$adr+8 ; long restore to A7 for new program
- err$line equ line$adr+12 ; long line start for error retry
- err$vect equ err$line+4 ; long error handler address
- data$ptr equ err$vect+8 ; long pointer to next DATA statement
- inp$retry equ err$vect+12 ; long prompt display for input retry
- inp$stack equ err$vect+16 ; long stack point for input retry
- seq$flg equ err$vect+21 ; byte Seq disk file compatibility
- trac$lin equ err$vect+22 ; word Last line number displayed
- opt$base equ err$vect+28 ; word min array number, option base
- dflt$flg equ opt$base+2 ; byte $FF -> default device
- prec$flg equ opt$base+3 ; byte precision of operation
- field$pnt equ opt$base+4 ; long pntr into file buf during FIELD
- width$255 equ opt$base+8 ; long default width and position
- ;
- ; Keyboard and Mouse
- ;
- keyin$idx equ opt$base+18 ; byte pointer into key input string
- key$in equ opt$base+20 ; long string for function key input
- ; mouse(0) .. mouse(6) ; 14 bytes mouse function values
- mouse$y equ opt$base+28 ; word MOUSE(2)
- mouse$x equ opt$base+30 ; word MOUSE(1)
- Atr$byte equ mouse$y+21 ; byte current Screen atribute
- Atr$Off equ mouse$y+22 ; word size of text buffer
- Cur$Evt equ mouse$y+24 ; Event record
- Cur$What equ Cur$Evt ; word Type of Event
- Cur$Msg equ Cur$Evt+2 ; long Info about event
- Cur$time equ Cur$Evt+6 ; long Tick when event occured
- Cur$msy equ Cur$Evt+10 ; word Event mouse y
- Cur$msx equ Cur$Evt+12 ; word Event mouse x
- Cur$Mod equ Cur$Evt+14 ; word Event case keys
- ;
- ; Register Storage
- ;
- pas$reg equ Cur$Evt+72 ; 36 bytes Pascal registers while in ASM
- asm$reg equ pas$reg+52 ; 40 bytes ASM registers while in Pascal
- ; A0 has return address
- ; LFN pointer table
- ;
- lfn$ptr equ asm$reg+44 ; 520 bytes LFN Pointers to file buffers
- ;
- ; Vector into generated code
- ;
- code$start equ lfn$ptr+772 ; long Start of current program
- ;
- ; entries to BASIC run-time code
- IMPORT Menu$Num
- IMPORT Wind$Num
- IMPORT l$$ea
- IMPORT dia$log
- IMPORT err$or
- IMPORT p$ause
- IMPORT r$esume
- IMPORT r$eturn
- IMPORT new$lin
- IMPORT new$pro
- IMPORT ret$pro
- IMPORT int$chk
- IMPORT trap$enab
- IMPORT key$on
- IMPORT key$off
- IMPORT key$list
- IMPORT key$set
- IMPORT heap$chk
- IMPORT pack$str
- IMPORT pack$ra
- IMPORT pack$sra
- IMPORT code$bot
- IMPORT e$nd
- IMPORT dim$pro
- IMPORT dim$fin
- IMPORT dim$chk
- IMPORT dim$val
- IMPORT add$str
- IMPORT r$4sng
- IMPORT r$4int
- IMPORT data$in
- IMPORT data$par
- IMPORT r$estore ; 2/3/85
- IMPORT dyn$mode
- IMPORT c$lear
- IMPORT set$file
- IMPORT open$file
- IMPORT c$lose
- IMPORT cl$all
- IMPORT inp$beg
- IMPORT inp$int
- IMPORT inp$sng
- IMPORT inp$dbl
- IMPORT inp$str
- IMPORT inp$lin
- IMPORT init$prus
- IMPORT pr$comma
- IMPORT pr$cr
- IMPORT pr$qm
- IMPORT pr$sng
- IMPORT pr$dbl
- IMPORT pr$int
- IMPORT pr$str
- IMPORT pr$tab
- IMPORT pr$htab
- IMPORT pr$spac
- IMPORT pr$btl
- IMPORT prus$int
- IMPORT prus$str
- IMPORT prus$sng
- IMPORT prus$dbl
- IMPORT prus$end
- IMPORT wr$cr
- IMPORT wr$int
- IMPORT wr$str
- IMPORT wr$sng
- IMPORT wr$dbl
- IMPORT l$oc
- IMPORT l$of
- IMPORT e$of
- IMPORT l$pos
- IMPORT wid$num
- IMPORT wid$str
- IMPORT e$ject
- IMPORT get$rec
- IMPORT put$rec
- IMPORT next$rec
- IMPORT k$ill
- IMPORT f$iles
- IMPORT ch$dir
- IMPORT re$name
- IMPORT c$hain
- IMPORT d$raw
- IMPORT c$ircle
- IMPORT l$ine
- IMPORT b$ox
- IMPORT box$fill
- IMPORT clr$scrn
- IMPORT clr$view
- IMPORT view$scrn
- IMPORT view$set
- IMPORT clr$wind
- IMPORT wind$scrn
- IMPORT wind$set
- IMPORT get$graph
- IMPORT put$graph
- IMPORT c$olor
- IMPORT l$ocate
- IMPORT csr$pat
- IMPORT scrn$pro
- IMPORT scrn$num
- IMPORT poin$num
- IMPORT poin$cor
- IMPORT plot$pro
- IMPORT p$map
- IMPORT p$lay
- IMPORT s$ound
- IMPORT m$ouse
- IMPORT t$imer
- IMPORT time$pro
- IMPORT time$str
- IMPORT date$pro
- IMPORT date$str
- IMPORT pen$num
- IMPORT str$dbl
- IMPORT sng$dbl
- IMPORT val$num
- IMPORT str$int
- IMPORT int$dlr
- IMPORT sng$dlr
- IMPORT dbl$dlr
- IMPORT sng$fix
- IMPORT sng$int
- IMPORT dbl$fix
- IMPORT dbl$int
- IMPORT re$long
- IMPORT re$cint
- IMPORT dbl$cint
- IMPORT dbl$sng
- IMPORT cv$i
- IMPORT cv$s
- IMPORT cv$d
- IMPORT mk$i
- IMPORT mk$s
- IMPORT mk$d
- IMPORT oct$str
- IMPORT hex$str
- IMPORT in$key
- IMPORT in$str
- IMPORT in$putstr
- IMPORT copy$heap
- IMPORT lit$str
- IMPORT l$set
- IMPORT r$set
- IMPORT mid$pro
- IMPORT stri$str
- IMPORT cmp$str
- IMPORT r$andom
- IMPORT sng$ipwr
- IMPORT dbl$ipwr
- IMPORT exp$sng
- IMPORT cmp$sing
- IMPORT dbl$sqrt
- IMPORT dbl$cos
- IMPORT dbl$sin
- IMPORT dbl$exp
- IMPORT tan$dbl
- IMPORT exp$dbl
- IMPORT dbl$atan
- IMPORT dbl$ln
- IMPORT add$dbl
- IMPORT div$dbl
- IMPORT mul$dbl
- IMPORT cmp$dbl
- IMPORT sub$dbl
- ; iosfplib links
- IMPORT add$sing ; sing add
- IMPORT sub$sing ; sing subtract
- IMPORT mul$sing ; sing multiply
- IMPORT div$sing ; sing divide
- IMPORT sng$sin ; sing sine
- IMPORT sng$cos ; sing cosine
- IMPORT tan$sng ; sing tangent
- IMPORT sng$flt ; longint to sing
- IMPORT sng$exp ; sing e ** x
- IMPORT sng$ln ; sing nat log
- IMPORT sng$sqrt ; sing square root
- IMPORT sng$atan ; sing arctangent
- ;
- ;
- ;
-
-
-
-